<?php

/*
// @author : lael
// blog : http://hi.baidu.com/lael80
// http://www.gzyd.net
// all right reserved.
*/

namespace ydsdk\controllers\admin;

class index extends \ydsdk\core\admin {
	public function __construct(){
		parent::__construct();
	}

	public function index(){
		if(issubmit()){
			$data = $this->formdata('admin');
			$this->db->update('admin', $data, "admin_id=".$_SESSION['admin']['admin_id']);
			exitjson(1);
		}
		$row = $this->db->get_row('admin', '*', array('admin_id' => $_SESSION['admin']['admin_id']));
		if(!$row)show_message('数据不存在');
		$this->smarty->assign('row', $row);	
		$this->smarty->display('index/index.html');	
	}
}
